package com.sanploy.manage.controller;

import com.sanploy.manage.service.ChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhu yingzhi on 2017/10/18.
 * @author yingzhi zhu
 * 统计图表请求路由
 */
@RestController
@RequestMapping("/charts")
public class ChartController {


    @Autowired
    private ChartService chartService;

    /**
     * 查找最近30天每天的销售额
     * @param days
     * @return
     */
    @GetMapping("recentSales")
    public Object getRecentOrderSales(@RequestParam int days){
        return chartService.getRecentOrderSales(days);
    }
}
